<!-- http://www.imooc.com/wiki/uniapp/databinding.html -->
<template>
  <view>
    <picker @change="chooseName" :value="index" :range="names">
      <view>
        我的名字是：{{names[index]}}
      </view>
    </picker>
  </view>
</template>

<script>
export default {
  data () {
    return {
      index: 0,
      names: ['小慕课', '大慕课', '老慕课']
    }
  },
  methods: {
    chooseName (e) {
      console.log("当前选择名字的索引是：",e.detail.value)
    }
  }
}
</script>
